package com.yikome.product.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.product.entity.Supplier;

@Repository
public interface SupplierRepository extends CommonRepository<Supplier, Long> {

	@Query("select t from Supplier t where t.yn = 1 and t.shopId = :shopId")
	Supplier findSupplierByShopId(@Param("shopId")String shopId);
	
	@Query("select t from Supplier t where t.yn = 1 and t.shopName = :shopName")
	Supplier findSupplierByName(@Param("shopName")String shopName);

}
